<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <link rel="icon" th:href="@{https://v3.bootcss.com/favicon.ico}">
    <title>员工列表</title>
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
</head>

<body>

<div th:insert="~{commons/commons::topbar}"></div>
<div class="container-fluid">
    <div class="row">

        <div th:insert="~{commons/commons::sidebar(active = 'list.html')}"></div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">修改员工信息</h1>


            <form method="post" th:action="@{/updateEmp}">
                <!-- id隐藏域标签   防止修改后出现一直增加的功能-->
                <input , name="id" th:value="${employee.getId()}" type="hidden">
                <div class="form-group">
                    <label for="1">用户名</label> <input class="form-control"
                                                      id="1" name="lastName"
                                                      placeholder="用户名" th:value="${employee.getLastName()}" type="text">
                </div>

                <div class="form-group">
                    <label for="b">Email address</label> <input class="form-control"
                                                                id="b" name="email"
                                                                placeholder="Email" th:value="${employee.getEmail()}" type="email">
                </div>

                <div class="form-group">
                    <label for="1">用户名</label>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input"
                               name="gender" th:checked="${employee.getGender() == 1}"
                               type="radio" value="1"> <label for="1">男</label>
                    </div>
                    <div class="form-check form-check-inline">
                        <input class="form-check-input"
                               name="gender" th:checked="${employee.getGender() == 0}"
                               type="radio" value="0"> <label for="1">女</label>
                    </div>
                </div>

                <div class="form-group">
                    <label for="1">部门</label> <select class="form-control"
                                                      name="department.id">
                    <option
                            th:each="dept : ${departments}"
                            th:selected="${dept.getId() == employee.getDepartment().getId()}"
                            th:text="${dept.getDepartmentName()}" th:value="${dept.getId()}"></option>
                </select>
                </div>

                <div class="form-group">
                    <label for="e">出生日期</label> <input class="form-control"
                                                       id="e"
                                                       name="birth" placeholder="出生日期" th:value="${#dates.format(employee.getBirth(), 'yyyy-MM-dd HH:mm:ss')}" type="text">
                </div>
                <button class="btn btn-default" type="submit">修改</button>
            </form>
        </div>
    </div>

</div>
</body>
</html>